package com.teacher.pojo.enums;

/**
 * @Author: zfm
 * @Date: 2021/8/3 13:53
 */
public enum FlowApproveType {
    /**
     * 流程审批状态
     */
    WAIT(10, "待审批"), PASS(20, "通过"),
    REFUSE(-10, "拒绝"), BACK_UPDATE(-20, "退回修改");
    private String type;
    private Integer code;

    FlowApproveType(Integer code, String type) {
        this.type = type;
        this.code = code;
    }

    public static Integer getCodeByName(String name) {
        for (FlowApproveType flowApproveType : FlowApproveType.values()) {
            if (flowApproveType.type.equals(name)) {
                return flowApproveType.code;
            }
        }
        return 0;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
